/*
 * Copyright (c) 2017年11月06日  by XuanWu Wireless Technology Co., Ltd 
 *             All rights reserved  
 */
package com.zml.service;

import com.zml.dao.ContactDao;
import com.zml.entity.Contact;
import com.zml.entity.ContactGroup;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author <a href="mailto:zhaominglin@wxchina.com">minglin.Zhao</a>
 * @Description
 * @Date 2017/11/6
 * @Version 1.0.0
 */
@Service
public class ContactService {

    @Autowired
    private ContactDao contactDao;

    public List<Contact> getAll() {
        return contactDao.getAll();
    }

    public int deleteById(int id) {
        return contactDao.deleteById(id);
    }

    public int updateContact(Contact contact) {
        return contactDao.updateContact(contact);
    }

    public int addContact(Contact contact) {
        return contactDao.addContact(contact);
    }

    public List<ContactGroup> getAllGroupNames() {
        return contactDao.getAllGroupNames();
    }

    public int deleteGroupNameWithName(String name) {
        return contactDao.deleteGroupNameWithName(name);
    }

    public int updateGroupNameWithName(ContactGroup group) {
        return contactDao.updateGroupNameWithName(group);
    }

    public int createGroupNameWithName(ContactGroup group) {
        return contactDao.createGroupNameWithName(group);
    }
}
